package nbcp.service

import nbcp.db.mysql.dbr
import nbcp.db.mysql.entity.s_user
import nbcp.db.mysql.match_equal
import nbcp.db.mysql.query
import nbcp.db.mysql.table.SystemGroup

fun SystemGroup.s_user_table.findByLoginName(loginName: String): s_user? {
    if (loginName.isEmpty()) return null;
    return dbr.system.s_user.query().where { it.loginName match_equal loginName }.toEntity()
}